﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EBookStore.Payments
{
    public class CreditCardPayment : Payment
    {
        /// <summary>
        /// Credit's card number
        /// </summary>
        public string CardNumber { get; set; }

        /// <summary>
        /// Credit card's type(enum)
        /// </summary>
        public eCreditCard CardType { get; set; }

        /// <summary>
        /// Constructor
        /// </summary>
        public CreditCardPayment(string CardNumber, eCreditCard CardType)
            : base()
        {
            this.CardNumber = CardNumber;
            this.CardType = CardType;
        }



        public CreditCardPayment() : base() { }

        /// <summary>
        /// Copy constructor.
        /// </summary>
        /// <param name="payment"></param>
        public CreditCardPayment(CreditCardPayment payment)
            : base(payment)
        {
            this.CardNumber = payment.CardNumber;
            this.CardType = payment.CardType;
        }


        #region IPaymentAction Members

        public override bool Charge()
        {
            //return Utils.RandomUtil.RandomBool();
            return true;
        }

        public override bool Refund()
        {
            //return Utils.RandomUtil.RandomBool();
            return true;
        }

        #endregion
    }
}
